#pragma once
#include <iostream>

/****************************************************创建型方式 抽象工厂******************************************************/

class AbstractButton
{
public:
    virtual void clicked() const = 0;
};

class AbstractCheckbox
{
public:
    virtual void clicked() const = 0;
};

class GUIFactory
{
public:
    virtual AbstractButton *createButton() const = 0;
    virtual AbstractCheckbox *createCheckbox() const = 0;
};

class WinFactory : public GUIFactory
{
public:
    virtual AbstractButton *createButton() const override;
    virtual AbstractCheckbox *createCheckbox() const override;
};

class MacFactory : public GUIFactory
{
public:
    virtual AbstractButton *createButton() const override;
    virtual AbstractCheckbox *createCheckbox() const override;
};
